<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>表情包详细</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="/dist/css/skins/_all-skins.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="/plugins/iCheck/flat/blue.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="/plugins/daterangepicker/daterangepicker-bs3.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet" href="/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="/js/html5shiv.min.js"></script>
    <script src="/js/respond.min.js"></script>
    <![endif]-->


<body class="skin-blue sidebar-mini wysihtml5-supported">
<jsp:include page="header.jsp"/>
<jsp:include page="menu.jsp"/>

<div class="content-wrapper">
    <section class="content-header">
        <h1>
            表情包详细
            <small>
                <sec:authorize url="/cusEmotionAdd">
                    <a href="/cusEmotionPrepareAdd?packetId=${packetId}" class="btn btn-block btn-info">添加表情</a>
                </sec:authorize>
            </small>

        </h1>
        <ol class="breadcrumb">
            <li><a href="${firstMenuUrl}"><i class="fa fa-dashboard"></i>${firstMenuName}</a></li>
            <li><a href="${secMenuUrl}"><i class="fa fa-dashboard"></i>${secMenuName}</a></li>
            <li class="active">表情包详细</li>
        </ol>
    </section>

    <section class="content">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title">

                </h3>
            </div>
            <div class="box-body">
                <div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
                    <div class="row">
                        <div class="col-sm-6"></div>
                        <div class="col-sm-6"></div>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <table id="example2" class="table table-bordered table-hover dataTable" role="grid"
                                   aria-describedby="example2_info">
                                <thead>
                                <tr role="row">
                                    <th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1"
                                        colspan="1">ID
                                    </th>
                                    <th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1"
                                        colspan="1">名称
                                    </th>
                                    <th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1"
                                        colspan="1">图片
                                    </th>
                                    <th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1"
                                        colspan="1">静态图
                                    </th>
                                    <th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1"
                                        colspan="1">附带值
                                    </th>
                                    <th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1"
                                        colspan="1">是否可用
                                    </th>
                                    <th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1"
                                          colspan="1">顺序
                                    </th>
                                    <th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1"
                                          colspan="1">操作
                                    </th>
                                </tr>
                                </thead>
                                <tbody>
                                <c:if test="${size==0}">
                                    <tr>
                                    </tr>
                                    <tr role="row" class="odd">
                                        <td class="sorting_1" colspan="8">暂无数据</td>
                                    </tr>
                                </c:if>
                                <c:forEach var="item" items="${cusEmotions}" varStatus="status">
                                    <tr>
                                    </tr>
                                    <tr role="row" class="odd">
                                        <td class="sorting_1">${item.id}</td>
                                        <td class="sorting_1">${item.name}</td>
                                        <td class="sorting_1"><img style="max-width:60px;max-lenght:60px"  src="${item.url}" alt=""/></td>
                                        <td class="sorting_1"><img style="max-width:60px;max-lenght:60px"  src="${item.urlJpg}" alt=""/></td>
                                        <td class="sorting_1">${item.code}</td>
                                        <c:if test="${item.available == 0}">
                                        <td class="sorting_1">不可用</td>
                                        </c:if>
                                        <c:if test="${item.available == 1}">
                                        <td class="sorting_1">可用</td>
                                        </c:if>
                                        <td class="sorting_1">${item.displayOrder}</td>
                                        <td class="sorting_1">
                                            <sec:authorize url="/cusEmotionEdit">
                                                <a href="/cusEmotionPrepareEdit?id=${item.id}">修改</a>
                                            </sec:authorize>
                                            <sec:authorize url="/cusEmotionDelete">
                                                 <a onclick="normalDelete('/cusEmotionDelete?id=${item.id}')" href="javascript:;">删除</a>
                                            </sec:authorize>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </div>

                    <div class="row">
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>


</div>
<script type="text/javascript">
    function normalDelete(url) {
        if (confirm("确定要删除吗？此操作不可恢复！")) {
             $.ajax({
                url : url,
                async : false,
                success: function (data) {
                    alert("删除成功");
                    window.location.reload();
                },
                error: function (msg) {
                    alert(msg.responseText);
                    window.location.reload();
                }
            });
        }
    };
</script>
<script type="text/javascript">
    function normalSubmit(pageNo){
        $("#page").val(pageNo);
        $("#normalForm").submit();
    }
</script>

<!-- jQuery 2.1.4 -->
<script src="/plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="/js/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
    $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.5 -->
<script src="/bootstrap/js/bootstrap.min.js"></script>
<!-- Sparkline -->
<script src="/plugins/sparkline/jquery.sparkline.min.js"></script>
<!-- jvectormap -->
<script src="/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
<script src="/plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
<!-- jQuery Knob Chart -->
<script src="/plugins/knob/jquery.knob.js"></script>
<!-- daterangepicker -->
<script src="/js/moment.min.js"></script>
<script src="/plugins/daterangepicker/daterangepicker.js"></script>
<!-- datepicker -->
<script src="/plugins/datepicker/bootstrap-datepicker.js"></script>
<!-- Bootstrap WYSIHTML5 -->
<script src="/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
<!-- Slimscroll -->
<script src="/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="/plugins/fastclick/fastclick.min.js"></script>
<!-- AdminLTE App -->
<script src="/dist/js/app.min.js"></script>
</body>
</html>